package com.zyb.warehouse.mapper;

import com.zyb.warehouse.entity.Auth;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Description:用户菜单树持久层
 */
@Mapper
public interface AuthMapper {

    /**
     * 根据用户id查询用户所有权限(菜单)的方法
     *
     * @param userId
     * @return
     */
    List<Auth> selectUserAllAuth(Integer userId);

    /**
     * 查询所有给角色分配的权限菜单树
     *
     * @return
     */
    @Select("select * from auth_info where auth_state=1 and auth_type!=3")
    List<Auth> selectAllAuthTree();

}
